package top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.service;

import top.yaofengqiao.springcloudsimple.auth.api.dto.TokenAuthResultDTO;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj.Oauth2Type;
import top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj.UserType;
import top.yaofengqiao.springcloudsimple.auth.biz.trigger.http.dto.Oauth2LoginDTO;
import top.yaofengqiao.springcloudsimple.auth.biz.trigger.http.dto.RefreshTokenDTO;
import top.yaofengqiao.springcloudsimple.auth.biz.trigger.http.dto.UsernameLoginDTO;
import top.yaofengqiao.springcloudsimple.auth.biz.trigger.http.vo.OauthTokenVO;

/**
 * @author yfq
 * @date 2024/6/1 15:29
 * @description
 */
public interface IAuthService {
    /**
     * 校验token
     *
     * @param token ...
     * @return ...
     */
    TokenAuthResultDTO authentication(String token);

    /**
     * 用户名密码登录
     *
     * @param usernameLoginDTO ...
     * @param userType         ...
     * @return ...
     */
    OauthTokenVO usernameLogin(UsernameLoginDTO usernameLoginDTO, UserType userType);

    /**
     * 三方授权登录
     *
     * @param oauth2LoginDTO ...
     * @param oauth2Type     ...
     * @return ...
     */
    OauthTokenVO oauth2Login(Oauth2LoginDTO oauth2LoginDTO, Oauth2Type oauth2Type);

    /**
     * 刷新token
     *
     * @param refreshTokenDTO ...
     * @return ...
     */
    OauthTokenVO refreshToken(RefreshTokenDTO refreshTokenDTO);

    /**
     * 获取三方授权url
     *
     * @param type ...
     * @return ...
     */
    String oauth2LoginUrl(Oauth2Type type);
}
